package cn.wawi.common.easyui;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @description easyui 树模型
 * @author 龚亮
 * @date 2015-05-24 14:44:56
 */
public class Tree implements java.io.Serializable{

	private static final long serialVersionUID = 1L;
	private Long id;
	private String text="";
	private String iconCls="";
	private Map<String,Object> attributes=new HashMap<String,Object>();
	public String state = "closed";
	public boolean checked = false;
	public Long _parentId;
	private List<Tree> children=new ArrayList<Tree>();
	
	public Tree(Long id,String text){
		this.id=id;
		this.text=text;
	}
	public Tree(){
		
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	public Map<String, Object> getAttributes() {
		return attributes;
	}
	public void setAttributes(Map<String, Object> attributes) {
		this.attributes = attributes;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public List<Tree> getChildren() {
		return children;
	}
	public void setChildren(List<Tree> children) {
		if(null==children||children.size()==0){
			this.state="open";
		}
		this.children = children;
	}
	public boolean isChecked() {
		return checked;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	public Long get_parentId() {
		return _parentId;
	}
	public void set_parentId(Long _parentId) {
		this._parentId = _parentId;
	}
}
